package com.letoo.sso.dataaccess.domain.dbo;

import java.util.Date;

/**
 * SSO系统中用户实体对象
 * 
 * @author dengjie
 *
 */
public class UserDO extends BaseDO {

    /**
     * 
     */
    private static final long serialVersionUID = -1596868913978482658L;
    /**
     * 注册用户来源，本系统
     */
    public static final int USER_ORIGIN_TYPE_MIAOMIAO = 0;
    /**
     * 注册用户来源，QQ第三方登陆
     */
    public static final int USER_ORIGIN_TYPE_QQ = 1;
    /**
     * 注册用户来源，微信第三方登陆
     */
    public static final int USER_ORIGIN_TYPE_WEIXIN = 2;
    /**
     * 注册用户来源，微博第三方登陆
     */
    public static final int USER_ORIGIN_TYPE_WEIBO = 3;

    /**
     * 注册用户的设备来源，未知系统。这个用于客户端获取不到设备型号的时候
     */
    public static final int USER_DEVICE_TYPE_UNKNOWN = 0;
    /**
     * 注册用户的设备来源，ANDROID
     */
    public static final int USER_DEVICE_TYPE_ANDROID = 1;
    /**
     * 注册用户的设备来源，IOS
     */
    public static final int USER_DEVICE_TYPE_IOS = 2;

    /**
     * 用户在线状态。不在线
     */
    public static final int USER_ONLINE_STATUS_OFF = 0;
    /**
     * 用户在线状态。在线
     */
    public static final int USER_ONLINE_STATUS_ON = 1;

    /**
     * 用户激活状态。禁用
     */
    public static final int USER_ENABLED_DISABLE = 0;
    /**
     * 用户激活状态。激活
     */
    public static final int USER_ENABLED_OK = 1;
    /*********************************************/
    /**
     * 用类型。店主和普通用户放一张表。帮助登录方便处理。1表示普通用户，2表示店主用户。
     */
    private int type;
    /**
     * 用户唯一ID。作为物理系统ID，主要是在数据迁移使用避免自增长后迁移困难
     */
    private long userId;
    /**
     * 桌游号。可能后期支持用户自定义桌游号所以支持字符串
     */
    private String bgId = "";
    /**
     * 绑定的手机号码(本系统注册时,此字段不能为空)
     */
    private String mobile = "";
    /**
     * 密码
     */
    private String password = "";
    /**
     * 注册时间
     */
    private Date registerTime;
    /**
     * 注册IP
     */
    private String registerIp = "";
    /**
     * 注册手机型号
     */
    private String phoneType = "";
    /**
     * 注册经度
     */
    private double lon;
    /**
     * 注册位置纬度
     */
    private double lat;
    /**
     * 注册地理位置
     */
    private String registerAddress = "";
    /**
     * 账号是否禁用(0:禁用,1:启动)。属于官方行为
     */
    private int enabled;
    /**
     * 来源类型(0:本系统注册,1:QQ登陆,2表示微信登陆,3表示微博登陆)。暂时未使用
     */
    private int originType;
    /**
     * 客户端设备标识(0:未知,1:ANDROID,2:IOS)
     */
    private int deviceType;
    /**
     * 邀请人妙喵号或者手机号
     */
    private String inviterMiaoId = "";
    /**
     * 最后登录时间。
     */
    private Date lastLoginTime;
    /**
     * 登陆次数。用于输入登陆账号密码错误太多后，我们会禁止例如30分钟后再允许登陆。
     */
    private int loginFrequency;
    /**
     * 我们的用户不存在服务器维护在线状态业务。但是这里记录标志位是为了满足以后业务扩展。0表示不在线。1表示在线。用户登陆后进行更新为在线，当用户退出后更新为不在线。这个为了后续一些需求做铺垫。
     */
    private int onlineStatus;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getBgId() {
        return bgId;
    }

    public void setBgId(String bgId) {
        this.bgId = bgId;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    public String getRegisterIp() {
        return registerIp;
    }

    public void setRegisterIp(String registerIp) {
        this.registerIp = registerIp;
    }

    public String getPhoneType() {
        return phoneType;
    }

    public void setPhoneType(String phoneType) {
        this.phoneType = phoneType;
    }

    public double getLon() {
        return lon;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public String getRegisterAddress() {
        return registerAddress;
    }

    public void setRegisterAddress(String registerAddress) {
        this.registerAddress = registerAddress;
    }

    public int getEnabled() {
        return enabled;
    }

    public void setEnabled(int enabled) {
        this.enabled = enabled;
    }

    public int getOriginType() {
        return originType;
    }

    public void setOriginType(int originType) {
        this.originType = originType;
    }

    public int getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(int deviceType) {
        this.deviceType = deviceType;
    }

    public String getInviterMiaoId() {
        return inviterMiaoId;
    }

    public void setInviterMiaoId(String inviterMiaoId) {
        this.inviterMiaoId = inviterMiaoId;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public int getLoginFrequency() {
        return loginFrequency;
    }

    public void setLoginFrequency(int loginFrequency) {
        this.loginFrequency = loginFrequency;
    }

    public int getOnlineStatus() {
        return onlineStatus;
    }

    public void setOnlineStatus(int onlineStatus) {
        this.onlineStatus = onlineStatus;
    }

    @Override
    public String toString() {
        return "UserDO [type=" + type + ", userId=" + userId + ", bgId=" + bgId + ", mobile=" + mobile + ", password="
                + password + ", registerTime=" + registerTime + ", registerIp=" + registerIp + ", phoneType="
                + phoneType + ", lon=" + lon + ", lat=" + lat + ", registerAddress=" + registerAddress + ", enabled="
                + enabled + ", originType=" + originType + ", deviceType=" + deviceType + ", inviterMiaoId="
                + inviterMiaoId + ", lastLoginTime=" + lastLoginTime + ", loginFrequency=" + loginFrequency
                + ", onlineStatus=" + onlineStatus + "]";
    }

}
